<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
    <div class="container-div">
    
    	<div class="col-sm-12 search-collapse">
				<form id="role-form">
					<div class="select-list">
						<ul>
							<li class="select-time">
								<label>筛选日期： </label>
								<input type="text" class="time-input" id="date" placeholder="筛选日期" name="date"/>
							</li>
							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
							    <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
    
		<div class="col-sm-12 select-table table-striped">
			<table id="bootstrap-table" data-mobile-responsive="true"></table>
		</div>
    </div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var prefix = ctx + "data";
        
        layui.use('laydate', function() {
        	var laydate = layui.laydate;
        	laydate.render({
          	  elem: '#date',//指定元素
          	  max:'nowTime',
          	  value:new Date()
          });
        });
        

        $(function() {
            var options = {
                url: prefix + "/stepList",
                modalName: "计步排名",
                search: false,
                columns: [{
		            checkbox: true
		        },
				{
		        	title: '序号',
		        	formatter: function (value, row, index) {
							return index+1;
					}
				},
				{
					field : 'imei', 
					title : '设备编号' 
				},
				{
					field : 'name', 
					title : '佩戴者姓名' 
				},
				{
					field : 'step', 
					title : '步数' 
				},
				{
					field : 'totalKm', 
					title : '距离' 
				},
				{
					field : 'totalKa', 
					title : '消耗卡路里' 
				}
		        /* {
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		            	var actions = [];
						return actions.join('');
		            }
		        } */
		        ]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>